import _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';
import _createClass from '@babel/runtime/helpers/esm/createClass';
var Logger = /*#__PURE__*/ (function () {
  function Logger() {
    _classCallCheck(this, Logger);
    this.successLogEnabled = false;
    this.failLogEnabled = true;
    this.logger = {
      log: console.log,
      success: console.log,
      fail: console.log,
    };
  }
  _createClass(Logger, [
    {
      key: 'setLogger',
      value: function setLogger(logger) {
        this.logger = logger;
      },
    },
    {
      key: 'log',
      value: function log() {
        var _this$logger;
        this.logger.log && (_this$logger = this.logger).log.apply(_this$logger, arguments);
      },
    },
    {
      key: 'success',
      value: function success() {
        var _this$logger2;
        if (!this.successLogEnabled) return;
        this.logger.success &&
          (_this$logger2 = this.logger).success.apply(_this$logger2, arguments);
      },
    },
    {
      key: 'fail',
      value: function fail() {
        var _this$logger3;
        if (!this.failLogEnabled) return;
        this.logger.fail && (_this$logger3 = this.logger).fail.apply(_this$logger3, arguments);
      },
    },
    {
      key: 'setSuccessLogEnabled',
      value: function setSuccessLogEnabled() {
        var successLogEnabled =
          arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
        this.successLogEnabled = successLogEnabled;
      },
    },
    {
      key: 'setFailLogEnabled',
      value: function setFailLogEnabled() {
        var failLogEnabled =
          arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
        this.failLogEnabled = failLogEnabled;
      },
    },
  ]);
  return Logger;
})();
export default new Logger();
